#ifndef MEMORY_H
#define MEMORY_H

#include <malloc.h>
#include <stdbool.h>
#include <stddef.h>

struct Memory {
  int id;
  void *data;
  struct Memory *next;
};

struct MemResult {
  int id;
  void *data;
};

struct Memory* init_memory();
struct MemResult new_memory(struct Memory *mem, size_t size);
bool free_memory(struct Memory *mem, int id);
void free_memory_all(struct Memory *mem);
int memory_count(struct Memory *mem);

#endif  // MEMORY_H
